package main

import (
	"fmt"
)

// 已知数组长度
func printArr1(nums *[2]int) {
	for k, v := range nums {
		fmt.Printf("%d: %d,", k, v)
	}
}

// 未知数组长度
func printArr2(nums ...int) {
	for k, v := range nums {
		fmt.Printf("%d: %d,", k, v)
	}
}

func main() {
	arr1 := [2]int{1, 2}
	arr2 := []int{1, 2, 3}

	printArr1(&arr1)
	printArr2(arr2...)
}
